﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace WpfScratchApp
{
    public class BindableObject : DependencyObject
    {
        // The dependency property
        public static readonly DependencyProperty TextProperty;

        static BindableObject()
        {
            // Register the property
            BindableObject.TextProperty = DependencyProperty.Register(
                "Text",
                typeof(string),
                typeof(BindableObject));//,
                //new FrameworkPropertyMetadata(false, new PropertyChangedCallback(OnTextChanged)));
        }

        // A .NET property wrapper (optional)
        public string Text
        {
            get { return (string)GetValue(BindableObject.TextProperty); }
            set { SetValue(BindableObject.TextProperty, value); }
        }
        
        // a property changed callback (optional)
        private static void OnTextChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
        }
    }
}
